package news.dao;


import news.model.News;
import news.model.NewsType;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface NewsDao {

    List<News> newsList(News news);

    @Select("select id,type from news_type")
    List<NewsType> newsType();

    @Update("update news_info set status = #{status} where id = #{id}")
    void changeStatus(Integer status,Integer id);

    void saveNews(News news);

    @Delete("delete from news_info where id=#{id}")
    void delete(Integer id);

    News findNewsById(int id);

    void update(News news);
}
